<template>
	<view>
	<view class="">
		<u-navbar back-text="重庆大学(管理员)" :customBack="back" backIconName=" " :backTextStyle="backTextColor" backIconColor="#39CCCC" :background="background">
			<view class="search-wrap" @click="toSearch">
				<!-- 如果使用u-search组件，必须要给v-model绑定一个变量 -->
				<u-search height="56" :showAction="false" ></u-search>
			</view>
		</u-navbar>

		<view class="">
			<view class="toptem">
				<u-swiper :list="swiper" border-radius="0" :effect3d="true"></u-swiper>
			</view>
			<u-gap bgColor="#ededed" height="20"></u-gap>
		<view>
			<u-grid :col="3">
					<u-grid-item bg-color="#ffffff">
						<view class="grid-text" @click="tosearchm">
							<image src="../../static/searchmes.png"  mode="aspectFill" class="u-image-container"></image>
							<div>学生信息查询</div>
							</view>
					</u-grid-item>
					<u-grid-item>
						
						<view class="grid-text" @click="tochangem">
							<image src="../../static/tianxie.png"  mode="aspectFill" class="u-image-container"></image>
							<div>学生信息修改</div>
							</view>
					</u-grid-item>
					<u-grid-item>
						
						<view class="grid-text" @click="toID">
							<image src="../../static/zhanghao.png"  mode="aspectFill" class="u-image-container"></image>
							<div>账号管理</div>
							</view>
					</u-grid-item>
					<u-grid-item>
						<view class="grid-text" @click="tosee()">
							<image src="../../static/fankui.png"  mode="aspectFill" class="u-image-container"></image>
							<div>查看反馈</div>
							</view>
					</u-grid-item>
					
				</u-grid>
				</view>
			<!-- list -->
			<list></list>
		</view>
		<u-back-top :scrollTop="scrollTop" :mode="modeTop" :bottom="bottomTop" :right="rightTop" :top="top" :icon="iconTop"
		 :custom-style="customStyle" :icon-style="iconStyleTop" :tips="tips">
		</u-back-top>
		
	</view>
	<view style="text-align: center;">
	
		<u @click="loadmore" style="color: #aa0000;">加载更多</u>
	</view>
	</view>
</template>

<script>
	import list from '@/components/list'
	export default {
		components:{list},
		data() {
			return {
				showmoreIcon:false,
				showlessIcon:true,
				swiper: [{
						image: '/static/1.jpg',
						title: '昨夜星辰昨夜风，画楼西畔桂堂东'
					},
					{
						image: '/static/2.PNG',
						title: '身无彩凤双飞翼，心有灵犀一点通'
					},
					{
						image: '/static/3.jpg',
						title: '谁念西风独自凉，萧萧黄叶闭疏窗，沉思往事立残阳'
					}
				],
				background: {
					'background-image': 'linear-gradient(45deg, #2BC3C8, #84E7B9)'
				},
				backTextColor: {
					'color': '#ffffff'
				},
				// top
				scrollTop: 0,
				modeTop: 'circle',
				bottomTop: 200,
				rightTop: 40,
				top: 600,
				iconTop: 'arrow-up',
				iconStyleTop: {
					color: '#ffffff',
					fontSize: '30rpx'
				},
				customStyle: {
					backgroundColor: '#39CCCC',
					color: '#ffffff'
				},
				tips: '顶部',
			}
		},
		onLoad() {

		},
		methods: {
			toSearch(){
				this.$common.navigateTo('/pages/index/search')
			},
			tosearchm(){
				uni.navigateTo({
					url:"/pages/chaxun_stu/chaxun_stu"
				})
			},
			back() { // 首页
				uni.navigateBack({
					delta: 2
				})
			},
			toDetail(){
				this.$common.navigateTo('/pages/index/detail')
			},
			// 回到顶部
			onPageScroll(e) {
				this.scrollTop = e.scrollTop;
			},
			loadmore(){
				uni.switchTab({
					url:'/pages/object/index',
					// fail: err => {
					//     console.error('Navigation failed:', err);
					//   }
				})
				// console.log("66")
			},
			tochangem(){
				uni.navigateTo({
					url:'/pages/index/bustime'
				})
			},
			
			toID(){
				uni.navigateTo({
					url:'/pages/login/zhuce'
				})
			},
			tosee(){
				uni.navigateTo({
					url:'/pages/display_fank/display_fank'
				})
			}
		}
	}
</script>

<style lang="scss">
	.search-wrap {
		margin: 0 30rpx 0 10rpx;
		flex: 1;
	}
	.grid-text {
		  display: flex;             /* 使用Flex布局 */
		    flex-direction: column;    /* 垂直方向布局 */
		    align-items: center;       /* 居中对齐 */
			font-size: 28rpx;
			margin-top: 4rpx;
			color: $u-type-info;
		}


	.u-body-item {
		font-size: 32rpx;
		color: #333;
		padding: 20rpx;
	}

	.u-body-item image {
		width: 180rpx;
		flex: 0 0 180rpx;
		height: 150rpx;
		border-radius: 6rpx;
		margin-right: 12rpx;
	}
	
	.height{
		height: 88rpx;
	}

	.toptem {
		padding: 20rpx 0;
	}
	.u-image-container {
	  flex: 0 0 auto; /* 让图片容器不占用多余的空间 */
	  width: 40rpx; /* 设置容器宽度，可以根据需要进行微调 */
	  height: 40rpx; /* 设置容器高度，保持和宽度相等 */
	}
</style>
